package com.xhwy.controller;

import com.xhwy.service.StatisticsService;
import com.xhwy.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 数据统计Controller
 */
@RestController
@RequestMapping("/statistics")
public class StatisticsController {

    @Autowired
    private StatisticsService statisticsService;

    /**
     * 数据总览
     * @return
     */
    @GetMapping("/synopsis")
    public R synopsis(){
        return statisticsService.synopsis();
    }

    /**
     * 获取今年每月份的营业额
     * @return
     */
    @GetMapping("/monthlyTurnover")
    public R monthlyTurnover(){

        return statisticsService.monthlyTurnover();
    }

    @GetMapping("/salesDistribution")
    public R salesDistribution(){
        return statisticsService.salesDistribution();
    }
}
